<?php
/*
 * СПВ
 **/
class SP_Form_CheckBox extends SP_Form_CommonField
{

	
	public function getHtml()
	{
		$attributes=SP_Helper_Html::makeAttributes($this->attributes);
		$name = empty($this->form_name)? $this->name : $this->form_name.'['.$this->name.']';
		$id=$this->name.'_id';
		$checked = $this->value? 'checked' : '';
		$out.='<input type="checkbox" name="'.$name.'" id="'.$id.'" value="1" '.$attributes.' '.$checked.' />';
		return $out;
	}
	
	public function getRequestValue()
	{
		$value=parent::getRequestValue();
		return (bool)$value;
	}
}